﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UIT.ScrumTool.Client.ControlService;

namespace UIT.ScrumTool.Client.Utilities.Team
{
    public class MemberInfo
    {
        private int userId;
        public int UserId
        {
            get { return userId; }
            set { userId = value; }
        }

        private int projectId;
        public int ProjectId
        {
            get { return projectId; }
            set { projectId = value; }
        }

        private int userRole;
        public int UserRole
        {
            get { return userRole; }
            set { userRole = value; }
        }

        private int projectUserId;
        public int ProjectUserId
        {
            get { return projectUserId; }
            set { projectUserId = value; }
        }

        private int teamId;
        public int TeamId
        {
            get { return teamId; }
            set { teamId = value; }
        }

        private string loginName;
        public string LoginName
        {
            get { return loginName; }
            set
            {
                loginName = value;
            }
        }

        private string fistName;
        public string FistName
        {
            get { return fistName; }
            set { fistName = value; }
        }

        private string lastName;
        public string LastName
        {
            get { return lastName; }
            set { lastName = value; }
        }

        private string email;
        public string Email
        {
            get { return email; }
            set { email = value; }
        }

        private string imType;
        public string IMType
        {
            get { return imType; }
            set { imType = value; }
        }

        private string im;
        public string IM
        {
            get { return im; }
            set { im = value; }
        }

        private byte[] picture;
        public byte[] Picture
        {
            get { return picture; }
            set { picture = value; }
        }

        private string companyPostion;
        public string CompanyPostion
        {
            get { return companyPostion; }
            set { companyPostion = value; }
        }

        private string profile;
        public string Profile
        {
            get { return profile; }
            set { profile = value; }
        }

        public static MemberInfo CreateMemberInfo(UserDto userDto, int projectId, int userRole, int projectUserId= 0, int teamId = 0)
        {
            MemberInfo memberInfo = new MemberInfo();
            memberInfo.UserId = userDto.Id;
            memberInfo.ProjectId = projectId;
            memberInfo.UserRole = userRole;
            memberInfo.ProjectUserId = projectUserId;
            memberInfo.TeamId = teamId;
            memberInfo.LoginName = userDto.LoginName;
            memberInfo.LastName = userDto.LastName;
            memberInfo.FistName = userDto.FistName;
            memberInfo.Email = userDto.Email;
            memberInfo.IM = userDto.IM;
            memberInfo.IMType = userDto.IMType;
            memberInfo.Picture = userDto.Picture;
            memberInfo.CompanyPostion = userDto.CompanyPostion;
            memberInfo.profile = userDto.Profile;
            return memberInfo;
        }
    }
}
